import React, { useEffect } from 'react'
import { useNavigate, useParams } from 'react-router-dom'

export default function Login() {
  const navigate = useNavigate()
  const params = useParams() // 获取路由参数
  console.log(params)
  useEffect(() => {
    console.log('Login组件挂载了')
    return () => {
      console.log('Login组件卸载了')
    }
  }, [])
  return (
    <div>
      <h1>Login</h1>
      <button
        onClick={() => {
          navigate(-1)
        }}
      >
        返回
      </button>
    </div>
  )
}
